<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>个人资料</title>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/style.css">
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css">
		<link rel="stylesheet" href="__INDEX__/css/yund.css">
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">个人资料</h1>
		</header>
		<div class="mui-content">
			<div class="gerenzl_nr">
				<form id="my_form" class="layui-form update_form mui-input-group gerenzl_group" action="" method="post">
					<div class="mui-input-row">
						<label>头像</label>
						<div class="actions" style="float: right;">
							<div class="file-btn">
								<input type="hidden" id="thumb" name="logo">
								<input onchange="UploadFile('bbwy',200)" type="file" accept="image/*" id="file" name="file" multiple style="display: none;">
								<span onclick="$('input[id=file]').click();">
									<img class='img_list' src="{$model.logo|default='__INDEX__/bg.png'}" id='thumb_img' style="width:65px;border-radius: 100%" >
								</span>
							</div>
						</div>
					</div>
					<div class="mui-input-row">
						<label>手机</label>
						<input type="text" readonly value="{$model.mobile}" style="width: 65%;" class="mui-input-group">
					</div>
					<div class="mui-input-row">
						<label>昵称</label>
						<input type="text" name="nick_name" value="{$model.nick_name}" class="mui-input-group" placeholder="请填写昵称">
					</div>
					<div class="hy_line"></div>
					<div class="mui-input-row">
						<label>性别：</label>
					    <div class="layui-input-block" style="text-align: right;">
					    	<input type="radio" name="sex" value="1" title="男" {if $model.sex == 1}checked{/if}>
					    	<input type="radio" name="sex" value="2" title="女" {if $model.sex == 2}checked{/if}>
					    </div>
					</div>
					<div class="mui-input-row">
						<label>爱好</label>
						<input type="text" name="love" value="{$model.love}" class="mui-input-group" placeholder="请填写爱好">
					</div>
					<div class="mui-input-row">
						<label>详细地址</label>
						<input type="text" name="address" value="{$model.address}" class="mui-input-group" placeholder="请填写详细地址 ">
					</div>
					<button class="layui-btn fjysq_sbtn" lay-submit lay-filter="demo1" style="margin-left: 38%;">保存</button>
				</form>
			</div>
		</div>
	</body>

</html>
<script type="text/javascript" src="__PUBLIC__/static/js/image.zip.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script type="text/javascript" src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	layui.use(['form'], function(){
		var $ = layui.jquery,form = layui.form;
	  	//监听提交
		form.on('submit(demo1)', function(data){
			$('#change_but').addClass("layui-btn-disabled");
			set_content();
			return false;
		});
	})
	
	function set_content(){
		$.ajax({
			type:"post",
			url: "{:url('index/member/update')}",
			data: $('#my_form').serialize(),
			success: function(data) {
				layer.msg(data.msg, {
				  icon: 1,
				  time: 1500 //2秒关闭（如果不配置，默认是3秒）
				}, function(){
					  if(data.code == 200) {
							location.href = data.url
					  }
				}); 
			}
		})
	}
	
</script>
